//
//  ChainSearchView.h
//  Chain
//
//  Created by zhaosh on 2018/4/3.
//  Copyright © 2018年 zhaosh. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, SearchViewType) {
    FXSearchViewTypeHeadV = 0, //导航栏样式
    FXSearchViewTypeTitleV     //表头样式
};

typedef void(^titleClicke)(void);

@protocol ChainSearchViewDelegate <NSObject>
@optional

// textfiled 右边按钮(清除)实现方法
- (void)FXScheduleSearchVDelegateRightBtnAction:(UITextField *)textF;
- (void)FXScheduleSearchVDelegateTextFieldShouldReturn:(NSString *)textFText;
- (void)FXScheduleSearchVDelegateTextFNotEdit:(BOOL )endEdit;
- (void)FXScheduleSearchVCleared;
@end

//开始编辑
typedef void(^StartEditingBlock)(BOOL startEdit);
typedef void(^textFeildTextLengthToZeroBlcok)(void);


@interface ChainSearchView : UIView

@property (nonatomic,strong)UITextField *searchTextF;
//输入最大字符
@property (nonatomic,assign)NSInteger canInputTextNum;
// 搜索框的类型
@property (nonatomic,assign)SearchViewType searchViewType;
// 搜索框能不能编辑（默认可以编辑）
@property (nonatomic,assign)BOOL textFCanEdit;
// 搜索框需不需要上下间隔，默认需要
@property (nonatomic,assign)BOOL haveSpace;
// 占位符
@property (nonatomic,copy)NSString * placeholder;
// delegata
@property (nonatomic,weak)id<ChainSearchViewDelegate> delegate;
@property (nonatomic,copy)StartEditingBlock startEditingBlock;
@property (nonatomic,copy)textFeildTextLengthToZeroBlcok textLengthToZeroBlock;
@property(strong,nonatomic)titleClicke titleClickedBlock;
@end

